<div class="panel panel-info">
    <div class="panel-heading">
        <div class="panel-title">
            功能导航 <small>{% if is_referee %}{% if contest.author.id == user_session.user_id %}/ 比赛发起人{% else %}裁判{% endif %}{% else %}参赛者{% endif %}</small>
        </div>
    </div>
    <div class="panel-body" style="padding-top:0; padding-bottom:0;">
        <h4>
            {% if user_session.is_logined %}
            <span class="text-{% if user_session.user_sex == 0 %}danger{% else %}info{% endif %}">{{ user_session.user_nickname }}</span>
            <small>
                <br />
                {{ user_session.user_realname }}<br />
            </small>
            {% else %}
                游客
            {% endif %}

        </h4>
    </div>
    <ul class="list-group">
        <a class="list-group-item {% if type == "index" %}active{% endif %}" href="{% url 'contest_body' contest.id %}"><span class="glyphicon glyphicon-home"></span> 比赛介绍</a>
        <a class="list-group-item {% if type == "problem_list" %}active{% endif %}" href="{% url 'contest_problems_list' contest.id %}"><span class="glyphicon glyphicon-th-list"></span> 问题列表</a>
        <a class="list-group-item {% if type == "status" %}active{% endif %}" href="{% url 'contest_status' contest.id %}"><span class="glyphicon glyphicon-tasks"></span> 评测状态</a>
        <a class="list-group-item {% if type == "rank_list" %}active{% endif %}" href="{% url 'contest_rank_list' contest.id %}"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span> 排行榜</a>
        <a class="list-group-item {% if type == "faq" %}active{% endif %}" href="{% url 'contest_faq' contest.id  %}"><span class="glyphicon glyphicon-question-sign"></span> 在线问答 ({{ faq_counter.0 }}/{{ faq_counter.1 }})</a>
        {% if contest.end_time < web_config.server_time %}
        <a class="list-group-item {% if type == "code_analyzer" %}active{% endif %}" href="{% url 'contest_mgr_code_analyzer' contest.id %}"><span class="glyphicon glyphicon-screenshot"></span> 实时代码查重</a>
        {% endif %}
        {% if is_referee %}
        <a class="list-group-item" href="{% url 'contest_rank_board' contest.id %}" target="_blank"><span class="glyphicon glyphicon-open"></span> 滚动排行榜</a>
        {% endif %}
    </ul>
</div>
{% if is_referee and user_session.user_id == contest.author.id %}
<div class="panel panel-warning">
    <div class="panel-heading">
        <div class="panel-title">
            管理导航
        </div>
    </div>
    <ul class="list-group">
        <a class="list-group-item {% if type == "setting" %}active{% endif %}" href="{% url 'contest_mgr_contest_setting' contest.id %}"><span class="glyphicon glyphicon-cog"></span> 比赛参数</a>
        <a class="list-group-item {% if type == "participants_mgr" %}active{% endif %}" href="{% url 'contest_mgr_participants' contest.id %}"><span class="glyphicon glyphicon-list-alt"></span> 参赛名单</a>
        <a class="list-group-item {% if type == "referees_mgr" %}active{% endif %}" href="{% url 'contest_mgr_referees' contest.id %}"><span class="glyphicon glyphicon-briefcase"></span> 裁判名单</a>
        <a class="list-group-item {% if type == "code_analyzer" %}active{% endif %}" href="{% url 'contest_mgr_code_analyzer' contest.id %}"><span class="glyphicon glyphicon-screenshot"></span> 比赛代码查重</a>
        {% if user_session.user_id == 'acm' %}
        <a class="list-group-item {% if type == "user_mgr" %}active{% endif %}" href="{% url 'contest_mgr_user' contest.id %}"><span class="glyphicon glyphicon-user"></span> 专用用户管理</a>
        <a class="list-group-item" href="{% url 'contest_mgr_send_balloon' contest.id %}" target="_blank"><span class="glyphicon glyphicon-flag"></span> 发气球</a>
        {% endif %}
    </ul>
</div>
{% endif %}